/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package factory;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;


/**
 *
 * @author wida46984148
 */
public class Naves {

    private static ArchiuConf NW;
    private static ArchiuConf NE;

    public static NauBase nausWida(String ref) throws SlickException{
        NauBase nb = null;
        if (NW == null) {
            NW = Conf.getUnitats();
        }
        if(ref.equals("Pistoler")){
            System.out.println(NW.getPropietatInt("vidaPistoler"));
        }else if (ref.equals("nave2")){
            //System.out.println("nave 2");

            // estaran en el archivo cnf
            Image img = new Image("src/data/plane.png");
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");

            nb = new NauWida1(30, 30, 3, new MoveShoot(2, st), img, exp);

        }else if(ref.equals("nave3")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot2.png");
            Image img = new Image("src/data/planeW.png");

            nb = new NauWida1(30, 30, 3, new MoveShoot(2, st), img,  exp);
        }
        return nb;
    }

    public static NauBase nausEnemigues(String ref) throws SlickException{
        NauBase nb = null;
        if (NE == null) {
            NE = Conf.getUnitats();
        }
        if(ref.equals("Pistoler")){
            System.out.println(NW.getPropietatInt("vidaPistoler"));
        } else if (ref.equals("nave0")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, -17, -99, exp);
        } else if (ref.equals("nave0A")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 100, -99, exp);
        } else if (ref.equals("nave0B")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 236, -99, exp);
        } else if (ref.equals("nave0C")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 365, -99, exp);
        } else if (ref.equals("nave0D")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 485, -99, exp);
        } else if (ref.equals("nave0E")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 593, -99, exp);
        } else if (ref.equals("nave0F")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga0(5, 5, new shootC(1, st), img, 695, -99, exp);
        } else if (ref.equals("nave1")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shootTnk.gif");
            Image img = new Image("src/data/tank.gif");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga1(10, 10, new shootI(1, st),new shootD(1, st), img, (int)(Math.random()*750+1), -99, exp);
        } else if (ref.equals("nave2A")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shootTnk.gif");
            Image img = new Image("src/data/heli.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga2(20, 20, new shootI(1, st),new shootD(1, st),new shootC(1, st), img, 300, -99, exp);
        } else if (ref.equals("nave2B")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shootTnk.gif");
            Image img = new Image("src/data/heli.png");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauEnemiga2(20, 20, new shootI(1, st),new shootD(1, st),new shootC(1, st), img, 600, -99, exp);
        } else if( ref.equals("boss1")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shootTnk.gif");
            Image img = new Image("src/data/chuck.jpg");
            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            nb = new NauBoss(20, 20, new shootI(2, st),new shootD(2, st),new shootC(2, st), img, 300, -99, exp);
        }
        return nb;



    }

}